import axios from "./request";
import Qs from "qs";

export default {
  get(url, params) {
    console.log(111, params);
    return axios({
      url: url,
      method: "get",
      params: params
    });
  },
  post(url, data) {
    return axios({
      url: url,
      method: "post",
      data: Qs.stringify(data),
      headers: { "Content-Type": "application/x-www-form-urlencoded" }
    });
  },
  postJson(url, data) {
    return axios({
      url: url,
      method: "post",
      data: data
    });
  },
  postFromData(url, data) {
    return axios({
      url: url,
      method: "post",
      data: data,
      headers: { "Content-Type": "multipart/form-data" }
    });
  }
};
